import request from '../utils/request';

export function login(user) {
  return request({
    url: '/user/login',
    method: 'post',
    data: {
      // h5 登录
      userId: user.username,
      mobile: user.username,
      fundId: user.username,
      password: user.password,
      loginType: user.loginType,
    },
  });
}

export function getUser() {
  return request({
    url: '/user',
  });
}

export function getUserFundInfo() {
  return request({
    url: '/user/fund/info',
  });
}

export function sendCaptcha(data) {
  return request({
    url: '/captcha/send',
    method: 'post',
    data,
  });
}

export function authCaptcha(data) {
  return request({
    url: '/captcha/auth',
    method: 'post',
    data,
  });
}

export function getRecommendPerson(id) {
  return request({
    url: '/recommend/person',
    params: {
      memberId: id,
    },
  });
}

export function isProInvestor() {
  return request({
    url: '/user/ispro',
  });
}

export function checkUser() {
  return request({
    url: '/user/check',
  });
}

export function sendMessage(data) {
  return request({
    url: '/user/message',
    method: 'post',
    data,
  });
}
